package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementArpStaticMapper;
import com.ruoyi.net.domain.ElementArpStatic;
import com.ruoyi.net.service.IElementArpStaticService;

/**
 * 网元-ARP配置-静态ARP配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementArpStaticServiceImpl implements IElementArpStaticService 
{
    @Autowired
    private ElementArpStaticMapper elementArpStaticMapper;

    /**
     * 查询网元-ARP配置-静态ARP配置
     * 
     * @param id 网元-ARP配置-静态ARP配置主键
     * @return 网元-ARP配置-静态ARP配置
     */
    @Override
    public ElementArpStatic selectElementArpStaticById(String id)
    {
        return elementArpStaticMapper.selectElementArpStaticById(id);
    }

    /**
     * 查询网元-ARP配置-静态ARP配置列表
     * 
     * @param elementArpStatic 网元-ARP配置-静态ARP配置
     * @return 网元-ARP配置-静态ARP配置
     */
    @Override
    public List<ElementArpStatic> selectElementArpStaticList(ElementArpStatic elementArpStatic)
    {
        return elementArpStaticMapper.selectElementArpStaticList(elementArpStatic);
    }

    /**
     * 新增网元-ARP配置-静态ARP配置
     * 
     * @param elementArpStatic 网元-ARP配置-静态ARP配置
     * @return 结果
     */
    @Override
    public int insertElementArpStatic(ElementArpStatic elementArpStatic)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementArpStatic.getId())) {
            elementArpStatic.setId(uuid);
        }
        elementArpStatic.setCreateBy(SecurityUtils.getUsername());
        elementArpStatic.setCreateTime(DateUtils.getNowDate());
        elementArpStatic.setUpdateBy(SecurityUtils.getUsername());
        elementArpStatic.setUpdateTime(DateUtils.getNowDate());
        return elementArpStaticMapper.insertElementArpStatic(elementArpStatic);
    }

    /**
     * 修改网元-ARP配置-静态ARP配置
     * 
     * @param elementArpStatic 网元-ARP配置-静态ARP配置
     * @return 结果
     */
    @Override
    public int updateElementArpStatic(ElementArpStatic elementArpStatic)
    {
        elementArpStatic.setUpdateBy(SecurityUtils.getUsername());
        elementArpStatic.setUpdateTime(DateUtils.getNowDate());
        return elementArpStaticMapper.updateElementArpStatic(elementArpStatic);
    }

    /**
     * 批量删除网元-ARP配置-静态ARP配置
     * 
     * @param ids 需要删除的网元-ARP配置-静态ARP配置主键
     * @return 结果
     */
    @Override
    public int deleteElementArpStaticByIds(String[] ids)
    {
        return elementArpStaticMapper.deleteElementArpStaticByIds(ids);
    }

    /**
     * 删除网元-ARP配置-静态ARP配置信息
     * 
     * @param id 网元-ARP配置-静态ARP配置主键
     * @return 结果
     */
    @Override
    public int deleteElementArpStaticById(String id)
    {
        return elementArpStaticMapper.deleteElementArpStaticById(id);
    }
}
